package view.components;

import java.awt.Button;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseListener;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.Popup;
import javax.swing.PopupFactory;
import javax.swing.border.BevelBorder;

import controller.Controller;

public class PopUpBuilder extends JPopupMenu {

	public PopUpBuilder() {
		super();
		JMenuItem item;
		setBorder(new BevelBorder(BevelBorder.RAISED));
		
		
	}

	public void addButton(String titel, MouseAdapter listener) {

		
		JMenuItem item = new JMenuItem(titel);
		item.addMouseListener(listener);
		item.setHorizontalTextPosition(JMenuItem.RIGHT);
		add(item );
		

	}
	
	public void show (int x,int y){
		show(Controller.getInstance().getGuiBuilder().getFrame(), x,y);
		
	}

}
